<?php

declare(strict_types=1);

namespace app\validate\settlement;

use think\Validate;

class PayoutValidate extends Validate
{
    protected $rule = [
        'statement_id' => 'require|integer|gt:0',
        'seller_org_id' => 'integer|gt:0',
        'amount' => 'float|gt:0',
        'currency' => 'max:10',
        'pay_method' => 'max:30',
        'pay_account' => 'max:120',
        'status' => 'in:0,1,2,3',
        'scheduled_at' => 'date',
        'remark' => 'max:255',
    ];

    protected $scene = [
        'create' => [
            'statement_id',
            'seller_org_id',
            ['amount', 'require|float|gt:0'],
            'currency',
            'pay_method',
            'pay_account',
            'scheduled_at',
            'remark',
        ],
        'update' => [
            'status',
            'amount',
            'currency',
            'pay_method',
            'pay_account',
            'scheduled_at',
            'remark',
        ],
    ];
}
